using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using T2.WebSecurity.Data.Controllers.Interfaces;
using T2.WebSecurity.Data.Entities.Interfaces;
using T2.WebSecurity.Business.Entities.Interfaces;
using T2.WebSecurity.Business.Entities;
using T2.WebSecurity.Data.Controllers;
using T2.WebSecurity.Business.Builders.Interface;
using T2.WebSecurity.Business.Translators;
using T2.WebSecurity.Business.Entities.Search.Interfaces;
using T2.WebSecurity.Data.Entities.Search.Interfaces;


//--Change Management Control - OAuthMembership Builder  --**********************
//--Created By: trooks
//--Description: OAuthMembership Builder Class
//--Created Date: 03/07/2013 10:48:40
//--*************************************************************

namespace T2.WebSecurity.Business.Builders
{
	public partial class OAuthMembership_Builder : IOAuthMembership_builder 
	{
		
	public List<IOAuthMembership_biz> BuildParts (IOAuthMembership_biz _param)
	{
			IOAuthMembership_biz temp = new OAuthMembership_biz();
			IOAuthMembershipController cont = new OAuthMembershipController();
			List<IOAuthMembership_biz> tempList = new List<IOAuthMembership_biz>();
			List<IOAuthMembership> tempData = new List<IOAuthMembership>();
			switch (_param.Action)
			{
				case "GetOne":
				temp = OAuthMembershipTranslator.TranslateFromDataLayer(cont.OAuthMembership_GetOne(OAuthMembershipTranslator.TranslateToDataLayer(_param)));
				tempList.Add(temp);
				return tempList;

				case "GetAll":
				tempData = cont.OAuthMembership_GetAll(OAuthMembershipTranslator.TranslateToDataLayer(_param));
				tempList = tempData.Select(p => OAuthMembershipTranslator.TranslateFromDataLayer(p)).Cast<IOAuthMembership_biz>().ToList();
				return tempList;

				case "UserProfile_OAuthMembership_ByParent":
				tempData = cont.UserProfile_OAuthMembership_ByParent(OAuthMembershipTranslator.TranslateToDataLayer(_param));
				tempList = tempData.Select(p => OAuthMembershipTranslator.TranslateFromDataLayer(p)).Cast<IOAuthMembership_biz>().ToList();
				return tempList;

			}
			return tempList;
}
	public List<IOAuthMembership_biz> BuildParts (IOAuthMembershipSearch_biz _param)
	{
			IOAuthMembership_biz temp = new OAuthMembership_biz();
			IOAuthMembershipController cont = new OAuthMembershipController();
			List<IOAuthMembership_biz> tempList = new List<IOAuthMembership_biz>();
			List<IOAuthMembership> tempData = new List<IOAuthMembership>();
			tempData = cont.OAuthMembership_Search(OAuthMembershipTranslator.TranslateSearchToDataLayer(_param));
			tempList = tempData.Select(p => OAuthMembershipTranslator.TranslateFromDataLayer(p)).Cast<IOAuthMembership_biz>().ToList();
			return tempList;

	}
		
	}
}
